﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using RaGE.Properties;

namespace RaGE
{
    public partial class JoinWindow : Form
    {
        public JoinWindow()
        {
            InitializeComponent();
        }

        public string FileName
        {
            get
            {
                return fileName;
            }
            set
            {
                fileName = value;
                //textBox_ElementFile->Text = fileName;
            }
        }

        public string LogDirectory
        {
            get
            {
                return logDirectory;
            }
            set
            {
                logDirectory = value;
                //textBox_LogDir->Text = logDirectory;
            }
        }

        private void ButtonBrowseELClick(object sender, EventArgs e)
        {
            var load = new OpenFileDialog();

            load.Filter = Resources.ElementsFilter;

            if (load.ShowDialog() == DialogResult.OK && System.IO.File.Exists(load.FileName))
                textBox_ElementFile.Text = load.FileName;
        }

        private void ButtonBrowseLogClick(object sender, EventArgs e)
        {
            var load = new FolderBrowserDialog();

            if (load.ShowDialog() == DialogResult.OK && System.IO.Directory.Exists(load.SelectedPath))
                textBox_LogDir.Text = load.SelectedPath;
        }

        private void ButtonOKClick(object sender, EventArgs e)
        {
            fileName = textBox_ElementFile.Text;
            logDirectory = textBox_LogDir.Text;
            AddNew = checkBox_AddNew.Checked;
            BackupNew = checkBox_BackupNew.Checked;

            ReplaceChanged = checkBox_ReplaceChanged.Checked;
            BackupChanged = checkBox_BackupChanged.Checked;
            RemoveMissing = checkBox_RemoveMissing.Checked;
            BackupMissing = checkBox_BackupMissing.Checked;

            DialogResult = DialogResult.OK;
            Close();
        }

        private void ButtonCancelClick(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();

        }


    }
}
